import os
import datetime


def creatDir(path):
    nowPath = os.path.abspath('.')
    fullPath = os.path.join(nowPath, path)
    if os.path.exists(fullPath):
        return 'have'
    else:
        os.makedirs(fullPath)
        return 'creat'

def creatDateDir():
    now = datetime.datetime.now()
    ymd = now.strftime("%Y-%m/%d")
    re = creatDir(ymd)
    return ymd

def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1] in ALLOWED_EXTENSIONS